package com.future.demo.domain;

import com.future.common.BaseModel;
import com.future.demo.constant.Tables;
import com.future.properties.IDG;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

/**
 * 数据库持久化对象
 *
 * @author WUWY
 * @create 2018-05-12 上午10:46
 **/
@Entity
@Table(name = Tables.PERSON)
@GenericGenerator(name = "id", strategy = IDG.UUID)
public class Person extends BaseModel<String> {

    @Column(name = "FIRSTNAME")
    @NotBlank(message = "firstname不允许为空")
    private String firstname;

    @Column(name = "LASTNAME")
    private String lastname;

    public Person() {
    }

    public Person(String firstname, String lastname) {
        this.firstname = firstname;
        this.lastname = lastname;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }
}
